# coding: UTF-8
# Filename : points_record_manage.py
# Company : imedia
# Author : rose
# -*-coding:utf-8 -*-
from api.common.common import *
from api.common import mysql,log,utils
from api.member import member_manage

#是否直接生成会员
def is_bacome_mem(cus_id):
    flag = False
    join_way = member_manage.get_join_way(cus_id)
    #当为0时候 则表示直接生成会员
    if join_way == 0:flag = True
    return flag

#生成会员
def reg_member(user_id, cus_id, mobile):
    flag = is_bacome_mem(cus_id)
    if flag:
        name = mobile
        gender = 0
        email = ''
        birthday = ''
        member_manage.insert_member(name, gender, email, birthday, user_id, cus_id)
    if flag:return 2
    else: return 1
